import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '供应商名称',
    align:"center",
    dataIndex: 'supplier'
   },
   {
    title: '联系人',
    align:"center",
    dataIndex: 'contacts'
   },
   {
    title: '联系电话',
    align:"center",
    dataIndex: 'phoneNum'
   },
   {
    title: '电子邮箱',
    align:"center",
    dataIndex: 'email'
   },
   {
    title: '备注',
    align:"center",
    dataIndex: 'description'
   },
   {
    title: '是否系统自带 0==系统 1==非系统',
    align:"center",
    dataIndex: 'isystem'
   },
   {
    title: '类型',
    align:"center",
    dataIndex: 'type'
   },
   {
    title: '启用',
    align:"center",
    dataIndex: 'enabled'
   },
   {
    title: '预收款',
    align:"center",
    dataIndex: 'advanceIn'
   },
   {
    title: '期初应收',
    align:"center",
    dataIndex: 'beginNeedGet'
   },
   {
    title: '期初应付',
    align:"center",
    dataIndex: 'beginNeedPay'
   },
   {
    title: '累计应收',
    align:"center",
    dataIndex: 'allNeedGet'
   },
   {
    title: '累计应付',
    align:"center",
    dataIndex: 'allNeedPay'
   },
   {
    title: '传真',
    align:"center",
    dataIndex: 'fax'
   },
   {
    title: '手机',
    align:"center",
    dataIndex: 'telephone'
   },
   {
    title: '地址',
    align:"center",
    dataIndex: 'address'
   },
   {
    title: '纳税人识别号',
    align:"center",
    dataIndex: 'taxNum'
   },
   {
    title: '开户行',
    align:"center",
    dataIndex: 'bankName'
   },
   {
    title: '账号',
    align:"center",
    dataIndex: 'accountNumber'
   },
   {
    title: '税率',
    align:"center",
    dataIndex: 'taxRate'
   },
   {
    title: '排序',
    align:"center",
    dataIndex: 'sort'
   },
   {
    title: '操作员',
    align:"center",
    dataIndex: 'creator'
   },
   {
    title: '租户id',
    align:"center",
    dataIndex: 'tenantId'
   },
   {
    title: '删除标记，0未删除，1删除',
    align:"center",
    dataIndex: 'deleteFlag'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '供应商名称',
    field: 'supplier',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入供应商名称!'},
          ];
     },
  },
  {
    label: '联系人',
    field: 'contacts',
    component: 'Input',
  },
  {
    label: '联系电话',
    field: 'phoneNum',
    component: 'Input',
  },
  {
    label: '电子邮箱',
    field: 'email',
    component: 'Input',
  },
  {
    label: '备注',
    field: 'description',
    component: 'Input',
  },
  {
    label: '是否系统自带 0==系统 1==非系统',
    field: 'isystem',
    component: 'InputNumber',
  },
  {
    label: '类型',
    field: 'type',
    component: 'Input',
  },
  {
    label: '启用',
    field: 'enabled',
    component: 'Input',
  },
  {
    label: '预收款',
    field: 'advanceIn',
    component: 'InputNumber',
  },
  {
    label: '期初应收',
    field: 'beginNeedGet',
    component: 'InputNumber',
  },
  {
    label: '期初应付',
    field: 'beginNeedPay',
    component: 'InputNumber',
  },
  {
    label: '累计应收',
    field: 'allNeedGet',
    component: 'InputNumber',
  },
  {
    label: '累计应付',
    field: 'allNeedPay',
    component: 'InputNumber',
  },
  {
    label: '传真',
    field: 'fax',
    component: 'Input',
  },
  {
    label: '手机',
    field: 'telephone',
    component: 'Input',
  },
  {
    label: '地址',
    field: 'address',
    component: 'Input',
  },
  {
    label: '纳税人识别号',
    field: 'taxNum',
    component: 'Input',
  },
  {
    label: '开户行',
    field: 'bankName',
    component: 'Input',
  },
  {
    label: '账号',
    field: 'accountNumber',
    component: 'Input',
  },
  {
    label: '税率',
    field: 'taxRate',
    component: 'InputNumber',
  },
  {
    label: '排序',
    field: 'sort',
    component: 'Input',
  },
  {
    label: '操作员',
    field: 'creator',
    component: 'InputNumber',
  },
  {
    label: '租户id',
    field: 'tenantId',
    component: 'InputNumber',
  },
  {
    label: '删除标记，0未删除，1删除',
    field: 'deleteFlag',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}